// 01 导入request
import request from "../utils/request";
export function Login(data){
  return request.post("/api/loginAdmin",data)
}
// 01 获取菜单的接口
export const GetMenu = ()=>request.get("/api/user_permission")

export const GetStaff = params=>request.get("/api/staff",{params})
// 获取角色的接口
export const GetRole = params=>request.get("/api/user_group",{params})
// 添加角色的接口
export const Addstaff = data=>request.post("/api/staff",data)
// 修改员工
export const UpdateStaff = data=>request.put("/api/staff",data)
//删除员工
export const DelStaff = id=>request.delete("/api/staff/"+id)
//更新图表
export const CountStaff = ()=>request.get("/api/countStaff");
//定义并导出登录api


//定义注册api
export function Register(data){
    return request.post("/api/registerAdmin",data)
}
//定义场地共享api
export const GetshareField = params=>request.get("/api/share_fields",{params})
//添加共享api
export const AddshareField = data=>request.post("/api/fields",data)
//删除共享
export const DelshareField = id =>request.delete("/api/fields/"+id)
//更新共享
export const upDateshare = data=>request.put("/api/fields",data)
//挂起获取场馆
export const Getcg = params =>request.get("/api/stadium",{params})
export const Getcg1 = params =>request.get("/api/stadium",{params})
//挂起获取运动类型
export const Getsports = params =>request.get("/api/sport",{params})
//获取挂起时间
export const Getsession = params =>request.get("/api/getSession",{params})
//获取挂起列表
export const holdList = params =>request.get("/api/hold_list",{params})
//批量挂起
export const holdBatch = data=>request.post("/api/hold_batch",data)
//取消挂起
export const Delgua = data=>request.put("/api/hold_del",data)
//session挂起
export const holdBatchBysession = data=>request.post("/api/hold_by_sessions",data)
